using System;
using System.Collections;
using System.ComponentModel;
using System.Configuration.Install;
using System.ServiceProcess;
namespace CodeBlooded.Spades.Services
{
	/// <summary>
	/// Summary description for SpadesInstaller.
	/// </summary>
	[RunInstaller(true)]
	public class SpadesInstaller : System.Configuration.Install.Installer
	{
		public SpadesInstaller()
		{
			ServiceProcessInstaller process = new ServiceProcessInstaller();

			process.Account = ServiceAccount.LocalSystem;

			ServiceInstaller serviceAdmin = new ServiceInstaller();

			serviceAdmin.StartType		= ServiceStartMode.Manual;
			serviceAdmin.ServiceName	= "SpadesAdminSvc";
			serviceAdmin.DisplayName	= "Spades Administration Service";
			
			// Microsoft didn't add the ability to add a description for the services we are going to install
			// To work around this we'll have to add the information directly to the registry but I'll leave
			// this exercise for later.


			// now just add the installers that we created to our parents container, the documentation
			// states that there is not any order that you need to worry about here but I'll still
			// go ahead and add them in the order that makes sense.
			Installers.Add( process );
			Installers.Add( serviceAdmin );
		}

	}
}
